DECLARE SUB ActionInstall
DECLARE SUB RemoveIniGarbage
DECLARE SUB Install
DECLARE FUNCTION AddOptFilesToCopyList (a%) AS LONG
DECLARE FUNCTION AddFontFiles() AS LONG
DECLARE FUNCTION InstallHostPCL() AS LONG
SUB ActionInstall STATIC
iAction% = 3
DummyItem$ = "1"
CursorSave% = ShowWaitCursor
SetSymbolValue SYM_CREATING_FONT$, MSG_Action0$
RemoveSymbol SYM_FONTSLIST$
FOR i% = 1 TO iAction%
AddListItem SYM_FONTSLIST$, DummyItem$
NEXT i%
sz$ = UIStartDlg(DLL_CUIDLL$, BUILDING_FILES, "SliderDlgProc", APPHELP, "FHelpDlgProc")
RemoveIniGarbage
ClearCopyList
IF GetListItem(SYM_CUSTOMCHECKSTATES$, DRIVERFILES) = VAL_CHKON$ THEN
SetSymbolValue SYM_CREATING_FONT$, MSG_Action1$
sz$ = UIStartDlg(DLL_CUIDLL$, BUILDING_FILES, "SliderDlgProc", APPHELP, "FHelpDlgProc")
dwI& = AddOptFilesToCopyList(DRIVERFILES)
ELSE
sz$ = UIStartDlg(DLL_CUIDLL$, BUILDING_FILES, "SliderDlgProc", APPHELP, "FHelpDlgProc")
END IF
sz$ = GetListItem(SYM_CUSTOMCHECKSTATES$, FONTFILES)
RemoveSymbol SYM_FONTSLIST$
IF (sz$ = VAL_CHKON$) OR (sz$ = VAL_CHKGREY$) THEN
SetSymbolValue SYM_CREATING_FONT$, MSG_Action2$
sz$ = UIStartDlg(DLL_CUIDLL$, BUILDING_FILES, "SliderDlgProc", APPHELP, "FHelpDlgProc")
dwI& = AddOptFilesToCopyList(FONTFILES)
GetFontFileList
ELSE
sz$ = UIStartDlg(DLL_CUIDLL$, BUILDING_FILES, "SliderDlgProc", APPHELP, "FHelpDlgProc")
END IF
IF GetListItem(SYM_CUSTOMCHECKSTATES$, SOUNDFILES) = VAL_CHKON$ THEN
SetSymbolValue SYM_CREATING_FONT$, MSG_Action3$
sz$ = UIStartDlg(DLL_CUIDLL$, BUILDING_FILES, "SliderDlgProc", APPHELP, "FHelpDlgProc")
IF DoesIniKeyExist (WinDir$+INI_SYSTEMINI, INI_DRIVERS$, INI_WAVE$) = 0 THEN
InstallSpeaker% = YES%
END IF
dwI& = AddOptFilesToCopyList(SOUNDFILES)
ELSE
sz$ = UIStartDlg(DLL_CUIDLL$, BUILDING_FILES, "SliderDlgProc", APPHELP, "FHelpDlgProc")
END IF
UIPop 1
IF CursorSave% <> 0 THEN
RestoreCursor(CursorSave%)
END IF
CursorSave% = 0
sz$ = ""
Install
END SUB
SUB RemoveIniGarbage STATIC
RemoveFile WinSysDir$+"wpscomm.dll", cmoNone
RemoveFile WinSysDir$+"wps.drv", cmoNone
RemoveFile WinSysDir$+"wpsqp.dll", cmoNone
RemoveFile WinSysDir$+"vjpd.386", cmoNone
RemoveFile WinSysDir$+"wpsljvcd.386", cmoNone
RemoveFile WinDir$+"wpsmain.hlp", cmoNone
RemoveFile WinSysDir$+"vlexcomd.386", cmoNone
RemoveFile WinSysDir$+"lexcom.dll", cmoNone
RemoveIniKey INI_WININI$, INI_SPOOLER$, INI_QP$+INI_WPSPORT$, cmoNone
RemoveIniKey INI_WININI$, INI_PRINTERPORTS$, "Lexmark Windows Printer", cmoNone
RemoveIniKey INI_WININI$, INI_DEVICES$, "Lexmark Windows Printer", cmoNone
RemoveIniSection WinDir$+INI_SYSTEMINI, INI_VJPD$, cmoNone
sz$ = ""
END SUB
SUB Install STATIC
SetSymbolValue SYM_RESOURCEBASENAME$, VAL_MAILMAN$
sz$ = UIStartDlg(DLL_CUIDLL$, BB_MAILMAN, "FBBoardDlgProc", APPHELP, "FHelpDlgProc")
CopyFilesInCopyList
UIPop 1
CursorSave% = ShowWaitCursor
junk% = InstallFontNeedsReboot()
IF GetListItem(SYM_CUSTOMCHECKSTATES$, DRIVERFILES) = VAL_CHKON$ THEN
junk% = InstallHostPCL()
END IF
IF CursorSave% <> 0 THEN
RestoreCursor(CursorSave%)
END IF
CursorSave% = 0
IF RestartListEmpty() <> FALSE THEN
junk% = SendMessage (-1, WM_WININICHANGED, 0, SECT_FONTINF$)
junk% = SendMessage (-1, WM_FONTCHANGE, 0, "")
END IF
END SUB
FUNCTION AddOptFilesToCopyList (ftype%) STATIC AS LONG
dwI& = 0
IF ftype% = 0 THEN
AddSectionFilesToCopyList SECT_FONTINF$, SrcDir$, WinSysDir$
dwI& = ClusterByte& * (GetListLength(SYM_TOTALFONTLIST$) + 1)
ELSE
sz$ = GetListItem(SYM_CUSTOMCHECKSTATES$, ftype%)
IF (sz$ = VAL_CHKON$) OR (sz$ = VAL_CHKGREY$) THEN
IF ftype% = DRIVERFILES THEN
AddSectionFilesToCopyList SECT_DLLINF$, SrcDir$, WinDir$
AddSectionFilesToCopyList SECT_HELPINF$, SrcDir$, WinDir$
AddSectionFilesToCopyList SECT_DRIVERINF$, SrcDir$, WinSysDir$
AddSectionFilesToCopyList SECT_PCL$, SrcDir$, WinSysDir$
AddSectionFilesToCopyList SECT_PCL2$, SrcDir$, WinDir$+"wps\"
AddSectionFilesToCopyList SECT_TESTPAGELIST$, SrcDir$, WinDir$+TestPageDir$+"\"
dwI& = 5120
ELSEIF ftype% = SOUNDFILES THEN
IF DoesIniKeyExist (WinDir$+INI_SYSTEMINI, INI_DRIVERS$, INI_WAVE$) = 0 THEN
AddSectionFilesToCopyList SECT_SPKRDRVINF$, SrcDir$, WinSysDir$
END IF
AddSectionFilesToCopyList SECT_SOUNDINF$, SrcDir$, WinSysDir$
dwI& = 512
ELSEIF ftype% = FONTFILES THEN
dwI& = AddFontFiles()
END IF
END IF
END IF
AddOptFilesToCopyList = dwI&
END FUNCTION
FUNCTION AddFontFiles() STATIC AS LONG
j% = GetListLength (SYM_FONTSELECTED$)
dwK& = 0
IF j% > 0 THEN
IF (j% = 1) AND (GetListItem(SYM_FONTSELECTED$, 1) = VAL_ALL$) THEN
AddSectionFilesToCopyList SECT_FONTINF$, SrcDir$, WinSysDir$
j% = GetListLength(SYM_TOTALFONTLIST$)
ELSE
FOR i% = 1 TO j% STEP 1
sz$ = GetListItem(SYM_TOTALFONTLIST$, VAL(GetListItem(SYM_FONTSELECTED$, i%)))
AddSectionKeyFileToCopyList SECT_FONTINF$, sz$, SrcDir$, WinSysDir$
NEXT i%
END IF
sz$ = ""
dwK& = ClusterByte& * (j% + 1)
END IF
AddFontFiles = dwK&
END FUNCTION
FUNCTION InstallHostPCL() STATIC AS LONG
sz$ = MSG_HOSTTITLE$
sz2$ = MSG_HOSTCMD$
CreateProgmanGroup sz$, WinDir$+"minolta.grp", cmonone
CreateProgmanItem sz$, sz2$, WinSysDir$+PCLFP$, WinSysDir$+PCLFP$, cmoOverwrite
ShowProgmanGroup sz$, 1, cmoNone
dwK& = 0
InstallHostPCL = dwK&
END FUNCTION
